<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:directive.page import="entities.*"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>choose le categorie</title>
<script language="JavaScript">
	function   aa()   { 
		var id = document.getElementsByName("id");
		var names=document.getElementsByName("name");
		var temp=new Array();
  		for   (var   i=0;i <id.length;i++)   { 
			if   (id[i].checked)   { 
				temp[0]=id[i].value;
				temp[1]=names[i].value;
				} 
			}
  		return temp;
	} 
	function   choisir(){ 
		var temps=new Array();
		temps=aa();
	     window.opener.getNewLinkValue(temps[0],temps[1]);
	     window.close();
	     
	} 


</script> 
</head>
<body>

  	<P><tr>choisir les categories</tr></P>
  	<table border="3">	
  	    <tr>
  	    	<td align="center">choisir le categories</td>
    		<td align="center">nom du Category</td>
    	</tr>
    <% 
    	List<Category> arrL=(List<Category>)request.getAttribute("allCate");
    	Iterator<Category> it=arrL.iterator();
    	while(it.hasNext()){
    		 Category tmCate= it.next();
    %>
    		<tr>
    			<td align="center"><input type="radio" name="id" value=<%=tmCate.getIdCategory()%>  ></td>
    			<td align="center"><input type="text" readonly name="name" value=<%=tmCate.getName() %>  ></td>
    		</tr>
    <%}%>
    
    </table>

      <input type="button" name="btnAdd" onclick="choisir()" value="Choisir votre categorie">

</body>
</html>